package org.example;

public class EmployeeManagementService {
    private EmployeeInformationDAO employeeDAO;
    private SalaryDAO salaryDAO;

    public EmployeeManagementService() {
        this.employeeDAO = new EmployeeInformationDAO();
        this.salaryDAO = new SalaryDAO();
    }

    public double calculateActualIncome(String identityCardNumber) {
        EmployeeInformation employee = employeeDAO.getEmployeeInformationById(identityCardNumber);
        Salary salary = salaryDAO.getSalaryById(employee.getBusinessTripId());
        return salary.getBasicSalary() + salary.getPerformanceBonus() + salary.getAllowance() + salary.getOvertimePay() - salary.getSocialInsurance();
    }
}
